import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class TcpDictServer extends TcpEchoServer{
	Map<String ,String > map=new HashMap<>();
	public TcpDictServer(int prot) throws IOException {
		super(prot);
		map.put("cat","小猫");
		map.put("dog","小狗");
	}
	@Override
	public String process(String request) {
		return map.getOrDefault(request,"该词不在词典中");
	}

	public static void main(String[] args) throws IOException {
		TcpDictServer tcpDictServer=new TcpDictServer(9090);
		tcpDictServer.start();
	}
}
